package com.yunxi.order.service;

import com.github.pagehelper.PageInfo;
import com.yunxi.core.web.ApiResult;
import com.yunxi.core.web.GlobalException;
import com.yunxi.core.web.LoginInfo;
import com.yunxi.order.pojo.*;
import com.yunxi.vehicle.pojo.VehicleCertReqVO;
import com.yunxi.vehicle.pojo.VehicleCertRespVO;

import io.swagger.annotations.ApiModel;
import java.util.List;

public interface OrderOemManagerDubboService {
    /**
     * 查询批售单信息
     * @param vo 查询条件
     * @param pageIndex 当前页
     * @param pageSize  每页显示数据行数
     * @return
     */

    public PageInfo<OrderOemRespVO> queryPmsOrderOemForPage(OrderOemReqVO vo, int pageIndex, int pageSize);

    /**
     * 修改订单申请审核
     * @param vo
     * @param pageNum
     * @param pageSize
     * @return
     */
    PageInfo<ModifyOrderRespVO> queryModifyOrderForPage(ModifyOrderReqVO vo, int pageNum, int pageSize);

    /**
     * 批售单详情查询
     * @param vo
     * @return
     */
    public OrderOemDetailsRespVO queryOrderOemDetails(OrderOemDetailsReqVO vo);

    /**
     * 批售单明细数据查询 已提交
     * @param vo 查询条件
     * @param pageIndex 当前页
     * @param pageSize 每页显示数据行数
     * @return
     */
    public PageInfo<OrderOemDetailsAlreadySubmitRespVO> queryOrderOemDetailsAlreadySubmitForPage(OrderOemDetailsAlreadySubmitReqVO vo, int pageIndex, int pageSize);

    /**
     * 提交批售单
     * @param vo
     * @return
     */
    public boolean submitOrderVehicle(OrderVehicleSubmitReqVO vo);

    public boolean updateOrderModifyApplyForCheckStatus(OrderModifyApplyReqVO vo);

    public boolean updateOrderCancelReasonForCheckStatus(OrderCancelReasonReqVO vo);

    /**
     * 修改保存批售单信息
     * @param vo
     * @return
     */
    public boolean updatePmsOrderOem(OrderOemUpdateReqVO vo);

    /**
     * 价格试算
     * @param vo
     * @return
     */
    public PriceTryComputeRespVO priceTryCompute(OrderOemSaveReqVO vo);

    public void savePmsOrderOemExByVip(OrderOemSaveReqVO vo, LoginInfo loginInfo);

    /**
     * 新增批售单
     * @param vo 查询条件
     * @return
     */
    public boolean savePmsOrderOem(OrderOemSaveReqVO vo,LoginInfo loginInfo);
    /**
     * 订单管理主数据查询
     * @param vo 查询条件
     * @param pageIndex 当前页
     * @param pageSize 每页显示数据行数
     * @return
     */
    public PageInfo<OrderVehicleManagerDetailsRespVO> queryOrderForPage(OrderVehicleManagerDetailsReqVO vo, int pageIndex, int pageSize);

    /**
     * 订单管理明细查询
     * @param vo
     * @return
     */
    public OrderVehicleDetailsRespVO queryOrderVehicleDetails(OrderVehicleDetailsReqVO vo);

    /**
     * 订单取消
     * @param vo 查询条件
     * @return
     */
    public boolean cancelOrderVehicle(OrderCancelReqVO vo);

    /**
     * 订单修改
     * @param vo 查询条件
     * @return
     */
    public boolean updateOrderVehicl(OrderVehiclReqVO vo) throws GlobalException;

    /**
     * 主机厂订单审批申请主数据查询
     * @param vo 查询条件
     * @param pageIndex 当前页
     * @param pageSize  每页显示数据行数
     * @return
     */
    public PageInfo<OrderApproveRespVO> queryOrderApproveInfoForPage(OrderApproveReqVO vo, int pageIndex, int pageSize);

    /**
     * 主机厂取消订单审核主数据查询
     * @param vo 查询条件
     * @param pageIndex 当前页
     * @param pageSize  每页显示数据行数
     * @return
     */
    public PageInfo<OrderApproveCancelRespVO> queryCancelOrderApproveForPage(OrderApproveCancelReqVO vo, int pageIndex, int pageSize);

    /**
     * 主机厂订单管理主数据查询
     * @param vo
     * @param pageIndex
     * @param pageSize
     * @return
     */
    public PageInfo<OrderVehicleManagerDetailsRespVO> queryOrderApproveForPage(OrderVehicleManagerDetailsReqVO vo,int pageIndex,int pageSize);


    /**
     * 订单导出
     *
     * @param vo 查询条件
     * @return ApiResult
     */
    ApiResult orderExport(OrderVehicleManagerDetailsReqVO vo);


    /**
     * 主机厂订单审核通过或驳回状态修改
     * @param vo 请求数据
     * @return
     */
    public boolean setOrderCheckStatus(OrderPassReqVO vo);

    /**
     * 主机厂订单优先级设置
     * @param vo
     * @return
     */
    boolean setOrderLevel(OrderSetLevelReqVO vo);

    /**
     * 主机厂订单管理订单明细查询
     * @param vo
     * @return
     */
    public OrderApproveDetailsRespVO queryOrderApproveDetails(OrderApproveDetailsReqVO vo);

    /**
     * 库存资源查询
     * @param pageNum
     * @param pageSize
     * @return
     */
    public PageInfo<StockResourceRespVO> queryStockResource(StockOrProductionLineResourceReqVO vo,int pageNum,int pageSize);

    /**
     * 产线资源查询
     * @param pageNum
     * @param pageSize
     * @return
     */
    public PageInfo<ProductionLineResourceRespVO> queryProductionLineResource(StockOrProductionLineResourceReqVO vo,int pageNum,int pageSize);

    /**
     * 订单配车更换
     * @param vo
     * @return
     */
    public boolean updateVinOfOrderVehicle(StockOrProductionLineResourceReqVO vo);

    /**
     * 合格证管理
     * @param vo
     * @param pageNum
     * @param pageSize
     * @return
     */
    public PageInfo<VehicleCertRespVO> queryVehicleCert(VehicleCertReqVO vo, int pageNum, int pageSize);

    /**
     * 自动配车
     * @param vo
     * @return
     */
    public ApiResult orderAutoMatchCar(OrderApproveAutoMatchCarReqVO vo);

    /**
     * 取消配车绑定
     * @param vo
     * @return
     */
    public boolean cancelMatchCar(OrderApproveAutoMatchCarReqVO vo);

    /**
     * 手动配车
     * @param vo
     * @return
     */
    public boolean handMatchCar(OrderApproveHandMatchCarReqVO vo);

    /**
     * 配车更换
     * @param vo
     * @return
     */
    public boolean chooseMatchCar(OrderApproveHandMatchCarReqVO vo);

    /**
     * 订单配车查询
     * @param vo
     * @param pageNum
     * @param pageSize
     * @return
     */
    public PageInfo<OrderVehicleManagerDetailsRespVO> queryOrderApproveMatchCarForPage(OrderVehicleManagerDetailsReqVO vo,int pageNum, int pageSize);

    /**
     * 订单审核查询
     * @param vo
     * @param pageNum
     * @param pageSize
     * @return
     */
    public PageInfo<OrderVehicleManagerDetailsRespVO> queryOrderApproveCheckForPage(OrderVehicleManagerDetailsReqVO vo,int pageNum, int pageSize);

    /**
     * 订单审核查询，订单导出
     * @param vo
     * @return
     */
    public PageInfo<OrderVehicleManagerDetailsRespVO> queryOrderApproveCheckForDownload(OrderVehicleManagerDetailsReqVO vo);
    /**
     * 订单优先级设置查询
     * @param vo
     * @param pageNum
     * @param pageSize
     * @return
     */
    public PageInfo<OrderVehicleManagerDetailsRespVO> queryOrderApprovePrioritySettingForPage(OrderVehicleManagerDetailsReqVO vo,int pageNum, int pageSize);

    public boolean updateOrderVehicleStatusByVin(String vin,Integer status);

    /**
     * 到批售单中查找当前VIN是否存在，如果存在表示已经配过车了
     * 如果不存在直接返回
     * @param vin
     */
    public void callSapInvokVehicleBatchOrderByVin(String vin);

    /**
     * 零售转批售
     * @param v
     * @param loginInfo
     * @return
     */
    ApiResult saveByOrderCustomer(OrderCustomerExOrderOemSaveReqVO v, LoginInfo loginInfo);

    public PageInfo<OrderModifyApplyRespVO> queryOrderModifyApplyForPage(OrderModifyApplyReqVO vo,int pageNum,int pageSize);

    /**
     * 查询未配车的订单
     * @return
     */
    public List<NoMatchCarOrderForDownloadRespVO> queryNoMatchCarOrderForDownload();


    PageInfo<ProductionLineResourceRespVO> pageProductionLineResourceByVehicleCode(StockOrProductionLineResourceReqVO vo, int pageNum, int pageSize);

    PageInfo<StockResourceRespVO> queryStockResourceByVehicleCode(StockOrProductionLineResourceReqVO vo, int pageNum, int pageSize);

    boolean handMatchCarVip(OrderApproveHandMatchCarReqVO vo);

    PageInfo<OrderVehicleManagerDetailsRespVO> queryOrderApproveCheckForPageVip(OrderVehicleManagerDetailsReqVO vo, int pageNum, int pageSize);

    PageInfo<OrderVehicleManagerDetailsRespVO> queryOrderApproveCheckExpienceForPage(OrderVehicleManagerDetailsReqVO vo, int pageNum, int pageSize);

    List<OrderVehicleManagerDetailsRespVO> queryOrderApproveCheckExpienceForDownload(OrderVehicleManagerDetailsReqVO vo);

    /**
     *  根据生产计划号查询是否配车，如配车则发送订单到SAP
     * @param vin VIN
     */
    void order2SapByVin(String vin);

    /**
     * 发送车辆状态到APP
     * @param customOrderNo 客户订单
     * @param vin VIN
     */
    void orderState2App(String customOrderNo, String vin);

}
